'''
Created on Mar 21, 2016

@author: JimmyMo
'''
from __future__ import print_function
import cli.app
import perfsyncore
import time
from boot import perfsynboot_rabbitmq

@cli.app.CommandLineApp
def command_line_app(app):
#     boot = perfsynboot.DirectBoot(perfsyncore.start)
    boot = perfsynboot_rabbitmq.RabbitMQBoot(perfsyncore.start)
    boot.boot()
#     perfsyncore.start()
#     interval = app.params.interval
#     print("interval is %d..." % interval)
#     schedule.every(interval).seconds.do(perfsyncore.start)
#     while 1:
#         schedule.run_pending()
#         time.sleep(1)
#     print("log file path is %s..." % app.params.log_path)
#     print("pattern file path is %s..." % app.params.pattern_path)
#     emitlog.start(app.params.interval, app.params.log_path, app.p arams.pattern_path)
command_line_app.add_param("-v", "--interval", help="interval (seconds) to emit log", default=3, type=int)
# command_line_app.add_param("-lp", "--log_path", help="file path to emit log", default='output.log', type=str)
# command_line_app.add_param("-pp", "--pattern_path", help="log pattern path to read", default='log_patterns.conf', type=str)

if __name__ == "__main__":
    r = command_line_app.run()